module.exports = {
    win:null,
    running: false,
    init: function(callback) {
        this.win = floaty.window(
            <frame id="mainFrame" gravity="center" bg="#0dee6b">
                <text id="playText" textSize="30sp" bg="#ff0000" textColor="#ffffff">走</text>
            </frame>
        )

        ui.run(() => {
            this.win.setPosition(50,1850)
            this.win.setSize(200, 200)
            this.win.playText.click(() =>{
                this.running = !this.running
                let text = this.running ? '停' : '走'
                this.win.playText.setText(text)
                callback(this.running)
            })
        })
    }
}